package org.xmlpersist.dao;

import java.sql.Connection;

/***
 * Factory class gives out specific database dao
 * 
 * @author rjinoy
 * 
 */
public class DAOFactory {

	public static DBDao getDao(String databaseName,Connection connection) {
		if ("postgresql".equals(databaseName)) {
			return new PostgreSQLDao(connection);
		} else if ("mysql".equals(databaseName)) {
			return new MySQLDao(connection);
		}
		return new CommonDao(connection);
	}
}
